﻿using Domain.Entitys;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EFCore.Configers
{
    public class UserRolesConfigers : IEntityTypeConfiguration<UserRoles>
    {
        /// <summary>
        /// 用户角色表
        /// </summary>
        /// <param name="builder"></param>
        public void Configure(EntityTypeBuilder<UserRoles> builder)
        {
            builder.ToTable(nameof(UserRoles));
            builder.HasKey(ur => ur.UserRolesID);
            builder.Property(ur => ur.UserID).IsRequired();
            builder.Property(ur => ur.RolesID).IsRequired();
        }
    }
}
